Core.Scheduler.AsyncAnim = function(interval) {
	Core.Scheduler.AsyncFunction.superclass.constructor.call(this, interval);
};

Env.extend(Core.Scheduler.AsyncAnim, Core.Scheduler.Async, {
	
	/**
	 * Invoked each time when the async animation is executed.
	 */
	run: function() {},
	
	/**
	 * Invoked when the async animation starts.
	 */
	onStart: function() {},
	
	/**
	 * Invoked when the async animation stops.
	 */
	onStop: function() {},
	
	/**
	 * Executes the async animation.
	 */
	execute: function() {
		if(this.running) {
			this.run();
			this._reschedule();
		}
	},
	
	/**
	 * Starts the async animation.
	 * Sets to running & schedules for next execution.
	 * Runs onStart method if scheduled successfully.
	 */
	start: function() {
		if(Core.Scheduler.AsyncAnim.superclass.start.call(this)) { this.onStart(); }
	},
	
	/**
	 * Stops async animation from scheduling for next execution.
	 * Runs onStop method at the end.
	 */
	stop: function() {
		Core.Scheduler.AsyncAnim.superclass.stop.call(this);
		this.onStop();
	}
});